import cv2
import matplotlib
import matplotlib.pyplot as plt

matplotlib.rcParams['font.sans-serif'] = ['SimHei']

image = cv2.imread('./img/scenery.png', cv2.IMREAD_GRAYSCALE)

output_image = cv2.bitwise_not(image)


plt.subplot(1, 2, 1)
plt.imshow(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))
plt.title('原图')
plt.axis('off')

plt.subplot(1, 2, 2)
plt.imshow(cv2.cvtColor(output_image, cv2.COLOR_BGR2RGB))
plt.title('反色图')
plt.axis('off')

plt.show()
